#!/usr/bin/env python
# ecoding = utf-8
__author__ = 'lihao'
import pandas as pd
from pandas import DataFrame
import matplotlib.pyplot as plot
target_url = ("https://archive.ics.uci.edu/ml/machine-learning-databases/undocumented/connectionist-bench/sonar/sonar.all-data")
# data = urllib2.urlopen(target_url)
rocksVMines = pd.read_csv(target_url, header=None, prefix="V")
for i in range(208):
    if rocksVMines.iat[i, 60] == "M":
        pcolor = "red"
    else:
        pcolor = "blue"
    dataRow = rocksVMines.ix[i, 0:60]
    dataRow.plot(color=pcolor)
plot.xlabel("Attribute Index")
plot.ylabel("Attribute Values")
plot.show()